package com.zjd.swing.browser;

import chrriis.common.UIUtils;
import chrriis.dj.nativeswing.swtimpl.NativeInterface;

import javax.swing.*;

/**
 * @Description: ${description}
 * @Author: sobey
 * @Email: sobey178@163.com
 * @Date: 2022/3/27 15:39
 */
public class MyBrowserUtils {
    public static void open(String title,String url){
//        final String url = "https://www.baidu.com";
//        final String title = "显示百度";

        UIUtils.setPreferredLookAndFeel();
        NativeInterface.open();
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                new MyBrowserControllerJFrame("控制器")
                .openBrowser(title,url);
                ;
            }
        });
        NativeInterface.runEventPump();
    }
}
